// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System.Text;

namespace SnapObjects.Data
{
    /// <summary>
    ///     Defines a data template, for exporting data from the JSON or XML format.
    /// </summary>
    public interface IDataTemplate
    {
        /// <summary>
        ///     Gets the content of the data template.
        /// </summary>
        string Content { get; }

        /// <summary>
        ///     Gets the file path of the data template.
        /// </summary>
        string FilePath { get; }

        DataFormat DataFormat { get; }

        /// <summary>
        ///     Loads the template from a file.
        /// </summary>
        /// <param name="filePath">The path of the file.</param>
        void LoadFile(string filePath);

        /// <summary>
        ///     Loads the template from a file and specifies the encoding for the content.
        /// </summary>
        /// <param name="filePath">The path of the file.</param>
        /// <param name="encoding">The encoding applied to the contents of the file.</param>
        void LoadFile(string filePath, Encoding encoding);

        /// <summary>
        ///     Loads the template from a string.
        /// </summary>
        /// <param name="content">he content of the template.</param>
        void LoadContent(string content);

        /// <summary>
        ///     Sets parameter values for the XML template.
        /// </summary>
        /// <param name="name">The name of the placeholder in the template.</param>
        /// <param name="value">The value to be assigned to the placeholder in the template.</param>
        void SetParameter(string name, object value);
    }
}
